﻿<%@ Page Language="C#" MasterPageFile="~/Tenmah.Master" AutoEventWireup="true" CodeBehind="EditUser.aspx.cs" Inherits="Tenmah.Web.Administrator.EditUser" Title="Untitled Page" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <script type="text/javascript" language="javascript" src="../Js/TenmahScripts.js"></script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentTitleContentPlaceHolder" runat="server">
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="SubmenuContentPlaceHolder" runat="server">
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
    <asp:FormView ID="UserFormView" runat="server">
        <ItemTemplate>
            <table border="0" cellpadding="0" cellspacing="0" style="border: 1px #999999 solid; background: #eeeeee; text-align: center; width: 100%;">
                <tr>
                    <td style="padding: 4px; width: 100px;">
                        <asp:Label ID="UserLogOnLabel" runat="server" Text="Логин" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:TextBox ID="UserLogOnTextBox" runat="server" Text='<%# Eval("LogOn") %>' />
                    </td>
                    <td>
                        
                    </td>
                </tr>
                <tr>
                    <td style="padding: 4px;">
                        <asp:Label ID="UserPasswordLabel" runat="server" Text="Пароль" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:TextBox ID="UserPasswordTextBox" runat="server" TextMode="SingleLine"/>                        
                    </td>
                    <td>
                        <asp:CheckBox ID="ShowPasswordCheckBox" runat="server" Text="Показать пароль" Checked="true" />                        
                    </td>
                </tr>                
                <tr>
                    <td style="padding: 4px; width: 100px;">
                        <asp:Label ID="LastNameLabel" runat="server" Text="Фамилия" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:TextBox ID="LastNameTextBox" runat="server" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="padding: 4px; width: 100px;">
                        <asp:Label ID="FirstNameLabel" runat="server" Text="Имя" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:TextBox ID="FirstNameTextBox" runat="server" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="padding: 4px; width: 100px;">
                        <asp:Label ID="MiddleNameLabel" runat="server" Text="Отчество" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:TextBox ID="MiddleNameTextBox" runat="server" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="padding: 4px;">
                        <asp:Label ID="UserRoleLabel" runat="server" Text="Роль" CssClass="label_black_normal" />
                    </td>
                    <td align="left" style="padding: 4px;"> 
                        <asp:CheckBoxList ID="UserRolesCheckBoxList" runat="server" >
                            <asp:ListItem Text="Студент" Value="1" onclick='ChangeViewStateControl("Faculty", this);ChangeViewStateControl("Cafhedra", this);ChangeViewStateControl("Group", this);ChangeViewStateControl("Course", this);' />
                            <asp:ListItem Text="Преподаватель" Value="2" onclick='ChangeViewStateControl("Faculty", this);ChangeViewStateControl("Cafhedra", this);' />
                            <asp:ListItem Text="Модератор" Value="3" onclick='ChangeViewStateControl("Faculty", this);'/>
                            <asp:ListItem Text="Администратор" Value="4" />
                        </asp:CheckBoxList>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr id="Faculty" style="position: absolute; visibility: hidden;">
                    <td style="padding: 4px;">
                        <asp:Label ID="FacultyLabel" runat="server" Text="Факультет" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:DropDownList ID="FacultyDropDownList" runat="server" />
                    </td>
                    <td>
                        <asp:LinkButton ID="AddFacultyLinkButton" runat="server" Text="Добавить" CssClass="link_button_normal" PostBackUrl="~/Administrator/EditFaculty.aspx" />                        
                    </td>                    
                </tr>                       
                <tr id="Cafhedra" style="position: absolute; visibility: hidden;">
                    <td style="padding: 4px;">
                        <asp:Label ID="CafhedraLabel" runat="server" Text="Кафедра" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:DropDownList ID="CafhedraDropDownList" runat="server" />
                    </td>
                    <td>
                        <asp:LinkButton ID="AddCafhedraLinkButton" runat="server" Text="Добавить" CssClass="link_button_normal" PostBackUrl="~/Administrator/EditCafhedra.aspx" />
                    </td>
                </tr>                       
                <tr id="Course" style="position: absolute; visibility: hidden;">
                    <td style="padding: 4px;">
                        <asp:Label ID="CourseLabel" runat="server" Text="Курс" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:DropDownList ID="CourseDropDownList" runat="server" />
                    </td>
                    <td>
                        <asp:LinkButton ID="AddCourseLinkButton" runat="server" Text="Добавить" CssClass="link_button_normal" PostBackUrl="~/Administrator/EditCourse.aspx"/>                        
                    </td>
                </tr>  
                <tr id="Group" style="position: absolute; visibility: hidden;">
                    <td style="padding: 4px;">
                        <asp:Label ID="GroupLabel" runat="server" Text="Группа" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:DropDownList ID="GroupDropDownList" runat="server" />
                    </td>
                    <td>
                        <asp:LinkButton ID="AddGroupLinkButton" runat="server" Text="Добавить" CssClass="link_button_normal" PostBackUrl="~/Administrator/EditGroup.aspx"/>                        
                    </td>
                </tr> 
                <tr>
                    <td colspan="3" style="padding: 4px; background: #aaaaaa; border: 1px #666666 solid;">                        
                        <asp:Button ID="SaveUserButton" runat="server" Text="Сохранить" OnClick="SaveUserButton_Click" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="DeleteUserButton" runat="server" Text="Удалить" OnClick="DeleteUserButton_Click" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="CancelButton" runat="server" Text="Отмена" PostBackUrl="~/Administrator/Manage_users.aspx" />
                    </td>
                </tr>
            </table>
        </ItemTemplate>
        <EmptyDataTemplate>
            <table border="0" cellpadding="0" cellspacing="0" style="border: 1px #999999 solid; background: #eeeeee; text-align: center; width: 100%;">
                <tr>
                    <td style="padding: 4px; width: 100px;">
                        <asp:Label ID="UserLogOnLabel" runat="server" Text="Логин" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:TextBox ID="UserLogOnTextBox" runat="server" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="padding: 4px;">
                        <asp:Label ID="UserPasswordLabel" runat="server" Text="Пароль" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:TextBox ID="UserPasswordTextBox" runat="server" TextMode="SingleLine"/>                        
                    </td>
                    <td>
                        <asp:CheckBox ID="ShowPasswordCheckBox" runat="server" Text="Показать пароль" Checked="true" />                        
                    </td>
                </tr>                
                <tr>
                    <td style="padding: 4px; width: 100px;">
                        <asp:Label ID="LastNameLabel" runat="server" Text="Фамилия" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:TextBox ID="LastNameTextBox" runat="server" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="padding: 4px; width: 100px;">
                        <asp:Label ID="FirstNameLabel" runat="server" Text="Имя" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:TextBox ID="FirstNameTextBox" runat="server" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="padding: 4px; width: 100px;">
                        <asp:Label ID="MiddleNameLabel" runat="server" Text="Отчество" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:TextBox ID="MiddleNameTextBox" runat="server" />
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="padding: 4px;">
                        <asp:Label ID="UserRoleLabel" runat="server" Text="Роль" CssClass="label_black_normal" />
                    </td>
                    <td align="left" style="padding: 4px;">                                                              
                        <asp:CheckBoxList ID="UserRolesCheckBoxList" runat="server">
                            <asp:ListItem Text="Студент" Value="1" onclick='ChangeViewStateControl("Faculty", this);ChangeViewStateControl("Cafhedra", this);ChangeViewStateControl("Group", this);ChangeViewStateControl("Course", this);' />
                            <asp:ListItem Text="Преподаватель" Value="2" onclick='ChangeViewStateControl("Faculty", this);ChangeViewStateControl("Cafhedra", this);' />
                            <asp:ListItem Text="Модератор" Value="3" onclick='ChangeViewStateControl("Faculty", this);'/>
                            <asp:ListItem Text="Администратор" Value="4" />
                        </asp:CheckBoxList>
                    </td>
                    <td>
                        &nbsp;
                    </td>
                </tr>
                <tr id="Faculty" style="position: absolute; visibility: hidden;">
                    <td style="padding: 4px;">
                        <asp:Label ID="FacultyLabel" runat="server" Text="Факультет" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:DropDownList ID="FacultyDropDownList" runat="server" />
                    </td>
                    <td>
                        <asp:LinkButton ID="AddFacultyLinkButton" runat="server" Text="Добавить" CssClass="link_button_normal" PostBackUrl="~/Administrator/EditFaculty.aspx" />
                    </td>
                </tr>                       
                <tr id="Cafhedra" style="position: absolute; visibility: hidden;">
                    <td style="padding: 4px;">
                        <asp:Label ID="CafhedraLabel" runat="server" Text="Кафедра" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:DropDownList ID="CafhedraDropDownList" runat="server" />
                    </td>
                    <td>
                        <asp:LinkButton ID="AddCafhedraLinkButton" runat="server" Text="Добавить" CssClass="link_button_normal" PostBackUrl="~/Administrator/EditCafhedra.aspx" />
                    </td>
                </tr>                       
                <tr id="Course" style="position: absolute; visibility: hidden;">
                    <td style="padding: 4px;">
                        <asp:Label ID="CourseLabel" runat="server" Text="Курс" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:DropDownList ID="CourseDropDownList" runat="server" />
                    </td>
                    <td>
                        <asp:LinkButton ID="AddCourseLinkButton" runat="server" Text="Добавить" CssClass="link_button_normal" PostBackUrl="~/Administrator/EditCourse.aspx"/>                        
                    </td>
                </tr>  
                <tr id="Group" style="position: absolute; visibility: hidden;">
                    <td style="padding: 4px;">
                        <asp:Label ID="GroupLabel" runat="server" Text="Группа" CssClass="label_black_normal" />
                    </td>
                    <td style="padding: 4px;">
                        <asp:DropDownList ID="GroupDropDownList" runat="server" />
                    </td>
                    <td>
                        <asp:LinkButton ID="AddGroupLinkButton" runat="server" Text="Добавить" CssClass="link_button_normal" PostBackUrl="~/Administrator/EditGroup.aspx"/>                        
                    </td>
                </tr> 
                <tr>
                    <td colspan="3" style="padding: 4px; background: #aaaaaa; border: 1px #666666 solid;">
                        <asp:Button ID="AddUserButton" runat="server" Text="Создать" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <asp:Button ID="CancelButton" runat="server" Text="Отмена" PostBackUrl="~/Administrator/Manage_users.aspx" />
                    </td>
                </tr>
            </table>
        </EmptyDataTemplate>
    </asp:FormView>
</asp:Content>
